package com.cyzy.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Message implements Serializable {

    private Integer messageid;
    private String fromUser;
    private Integer toUserid;
    private List<Integer> toUserids;
    private String toUser;
    private String content;
    private Date sendTime;
    private boolean isRead;
    private MessageType messageType = MessageType.MESSAGE;

    public Message(String fromUser, Integer toUserid, String toUser, String content) {
        this.fromUser = fromUser;
        this.toUserid = toUserid;
        this.toUser = toUser;
        this.content = content;
        this.sendTime = new Date();
        this.isRead = false;
    }

    public Message(Integer messageid) {
        this.messageid = messageid;
    }

    public MessageType getMessageType() {
        return messageType;
    }

    public void setMessageType(MessageType messageType) {
        this.messageType = messageType;
    }
}